\section{soe\+\_\+request.\+c File Reference}
\label{soe__request_8c}\index{soe\+\_\+request.\+c@{soe\+\_\+request.\+c}}


Sercos-\/over-\/\+Ether\+C\+AT request functions.  


\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\mbox{\label{soe__request_8c_a4a6708f336ebb21896abbd6b9c272ec2}} 
\#define \textbf{ E\+C\+\_\+\+S\+O\+E\+\_\+\+R\+E\+Q\+U\+E\+S\+T\+\_\+\+R\+E\+S\+P\+O\+N\+S\+E\+\_\+\+T\+I\+M\+E\+O\+UT}~1000
\begin{DoxyCompactList}\small\item\em Default timeout in ms to wait for SoE responses. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \textbf{ ec\+\_\+soe\+\_\+request\+\_\+clear\+\_\+data} (\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$req)
\begin{DoxyCompactList}\small\item\em Free allocated memory. \end{DoxyCompactList}\item 
void \textbf{ ec\+\_\+soe\+\_\+request\+\_\+init} (\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$req)
\begin{DoxyCompactList}\small\item\em SoE request constructor. \end{DoxyCompactList}\item 
void \textbf{ ec\+\_\+soe\+\_\+request\+\_\+clear} (\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$req)
\begin{DoxyCompactList}\small\item\em SoE request destructor. \end{DoxyCompactList}\item 
int \textbf{ ec\+\_\+soe\+\_\+request\+\_\+copy} (\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$req, const \textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$other)
\begin{DoxyCompactList}\small\item\em Copy another SoE request. \end{DoxyCompactList}\item 
void \textbf{ ec\+\_\+soe\+\_\+request\+\_\+set\+\_\+drive\+\_\+no} (\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$req, uint8\+\_\+t drive\+\_\+no)
\begin{DoxyCompactList}\small\item\em Set drive number. \end{DoxyCompactList}\item 
void \textbf{ ec\+\_\+soe\+\_\+request\+\_\+set\+\_\+idn} (\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$req, uint16\+\_\+t idn)
\begin{DoxyCompactList}\small\item\em Set I\+DN. \end{DoxyCompactList}\item 
int \textbf{ ec\+\_\+soe\+\_\+request\+\_\+alloc} (\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$req, size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em Pre-\/allocates the data memory. \end{DoxyCompactList}\item 
int \textbf{ ec\+\_\+soe\+\_\+request\+\_\+copy\+\_\+data} (\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$req, const uint8\+\_\+t $\ast$source, size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em Copies SoE data from an external source. \end{DoxyCompactList}\item 
int \textbf{ ec\+\_\+soe\+\_\+request\+\_\+append\+\_\+data} (\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$req, const uint8\+\_\+t $\ast$source, size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em Copies SoE data from an external source. \end{DoxyCompactList}\item 
void \textbf{ ec\+\_\+soe\+\_\+request\+\_\+read} (\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$req)
\begin{DoxyCompactList}\small\item\em Request a read operation. \end{DoxyCompactList}\item 
void \textbf{ ec\+\_\+soe\+\_\+request\+\_\+write} (\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$req)
\begin{DoxyCompactList}\small\item\em Request a write operation. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Sercos-\/over-\/\+Ether\+C\+AT request functions. 



\subsection{Function Documentation}
\mbox{\label{soe__request_8c_a061dca3585d23f3b16ca46a90b53b9de}} 
\index{soe\+\_\+request.\+c@{soe\+\_\+request.\+c}!ec\+\_\+soe\+\_\+request\+\_\+clear\+\_\+data@{ec\+\_\+soe\+\_\+request\+\_\+clear\+\_\+data}}
\index{ec\+\_\+soe\+\_\+request\+\_\+clear\+\_\+data@{ec\+\_\+soe\+\_\+request\+\_\+clear\+\_\+data}!soe\+\_\+request.\+c@{soe\+\_\+request.\+c}}
\subsubsection{ec\+\_\+soe\+\_\+request\+\_\+clear\+\_\+data()}
{\footnotesize\ttfamily void ec\+\_\+soe\+\_\+request\+\_\+clear\+\_\+data (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$}]{req }\end{DoxyParamCaption})}



Free allocated memory. 


\begin{DoxyParams}{Parameters}
{\em req} & SoE request. \\
\hline
\end{DoxyParams}


Definition at line 129 of file soe\+\_\+request.\+c.

\mbox{\label{soe__request_8c_ac48c2c807e1193b309dc20b08db88af1}} 
\index{soe\+\_\+request.\+c@{soe\+\_\+request.\+c}!ec\+\_\+soe\+\_\+request\+\_\+init@{ec\+\_\+soe\+\_\+request\+\_\+init}}
\index{ec\+\_\+soe\+\_\+request\+\_\+init@{ec\+\_\+soe\+\_\+request\+\_\+init}!soe\+\_\+request.\+c@{soe\+\_\+request.\+c}}
\subsubsection{ec\+\_\+soe\+\_\+request\+\_\+init()}
{\footnotesize\ttfamily void ec\+\_\+soe\+\_\+request\+\_\+init (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$}]{req }\end{DoxyParamCaption})}



SoE request constructor. 


\begin{DoxyParams}{Parameters}
{\em req} & SoE request. \\
\hline
\end{DoxyParams}


Definition at line 56 of file soe\+\_\+request.\+c.

\mbox{\label{soe__request_8c_af363b99bdce32c73c89bcec7520b5d01}} 
\index{soe\+\_\+request.\+c@{soe\+\_\+request.\+c}!ec\+\_\+soe\+\_\+request\+\_\+clear@{ec\+\_\+soe\+\_\+request\+\_\+clear}}
\index{ec\+\_\+soe\+\_\+request\+\_\+clear@{ec\+\_\+soe\+\_\+request\+\_\+clear}!soe\+\_\+request.\+c@{soe\+\_\+request.\+c}}
\subsubsection{ec\+\_\+soe\+\_\+request\+\_\+clear()}
{\footnotesize\ttfamily void ec\+\_\+soe\+\_\+request\+\_\+clear (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$}]{req }\end{DoxyParamCaption})}



SoE request destructor. 


\begin{DoxyParams}{Parameters}
{\em req} & SoE request. \\
\hline
\end{DoxyParams}


Definition at line 77 of file soe\+\_\+request.\+c.

\mbox{\label{soe__request_8c_a0aed2b2f97cf1436f7f778ccfb8c5553}} 
\index{soe\+\_\+request.\+c@{soe\+\_\+request.\+c}!ec\+\_\+soe\+\_\+request\+\_\+copy@{ec\+\_\+soe\+\_\+request\+\_\+copy}}
\index{ec\+\_\+soe\+\_\+request\+\_\+copy@{ec\+\_\+soe\+\_\+request\+\_\+copy}!soe\+\_\+request.\+c@{soe\+\_\+request.\+c}}
\subsubsection{ec\+\_\+soe\+\_\+request\+\_\+copy()}
{\footnotesize\ttfamily int ec\+\_\+soe\+\_\+request\+\_\+copy (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$}]{req,  }\item[{const \textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$}]{other }\end{DoxyParamCaption})}



Copy another SoE request. 

\begin{DoxyReturn}{Returns}
Zero on success, otherwise a negative error code. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em req} & SoE request. \\
\hline
{\em other} & Other SoE request to copy from. \\
\hline
\end{DoxyParams}


Definition at line 90 of file soe\+\_\+request.\+c.

\mbox{\label{soe__request_8c_a33b01e254978df8b620d4dccc1d42569}} 
\index{soe\+\_\+request.\+c@{soe\+\_\+request.\+c}!ec\+\_\+soe\+\_\+request\+\_\+set\+\_\+drive\+\_\+no@{ec\+\_\+soe\+\_\+request\+\_\+set\+\_\+drive\+\_\+no}}
\index{ec\+\_\+soe\+\_\+request\+\_\+set\+\_\+drive\+\_\+no@{ec\+\_\+soe\+\_\+request\+\_\+set\+\_\+drive\+\_\+no}!soe\+\_\+request.\+c@{soe\+\_\+request.\+c}}
\subsubsection{ec\+\_\+soe\+\_\+request\+\_\+set\+\_\+drive\+\_\+no()}
{\footnotesize\ttfamily void ec\+\_\+soe\+\_\+request\+\_\+set\+\_\+drive\+\_\+no (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$}]{req,  }\item[{uint8\+\_\+t}]{drive\+\_\+no }\end{DoxyParamCaption})}



Set drive number. 


\begin{DoxyParams}{Parameters}
{\em req} & SoE request. \\
\hline
{\em drive\+\_\+no} & Drive Number. \\
\hline
\end{DoxyParams}


Definition at line 105 of file soe\+\_\+request.\+c.

\mbox{\label{soe__request_8c_a1433bb1213a1ae25b9f9e5fdd9002668}} 
\index{soe\+\_\+request.\+c@{soe\+\_\+request.\+c}!ec\+\_\+soe\+\_\+request\+\_\+set\+\_\+idn@{ec\+\_\+soe\+\_\+request\+\_\+set\+\_\+idn}}
\index{ec\+\_\+soe\+\_\+request\+\_\+set\+\_\+idn@{ec\+\_\+soe\+\_\+request\+\_\+set\+\_\+idn}!soe\+\_\+request.\+c@{soe\+\_\+request.\+c}}
\subsubsection{ec\+\_\+soe\+\_\+request\+\_\+set\+\_\+idn()}
{\footnotesize\ttfamily void ec\+\_\+soe\+\_\+request\+\_\+set\+\_\+idn (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$}]{req,  }\item[{uint16\+\_\+t}]{idn }\end{DoxyParamCaption})}



Set I\+DN. 


\begin{DoxyParams}{Parameters}
{\em req} & SoE request. \\
\hline
{\em idn} & I\+DN. \\
\hline
\end{DoxyParams}


Definition at line 117 of file soe\+\_\+request.\+c.

\mbox{\label{soe__request_8c_aebb7a81aa9fea2e882edce1bb4ccc8b6}} 
\index{soe\+\_\+request.\+c@{soe\+\_\+request.\+c}!ec\+\_\+soe\+\_\+request\+\_\+alloc@{ec\+\_\+soe\+\_\+request\+\_\+alloc}}
\index{ec\+\_\+soe\+\_\+request\+\_\+alloc@{ec\+\_\+soe\+\_\+request\+\_\+alloc}!soe\+\_\+request.\+c@{soe\+\_\+request.\+c}}
\subsubsection{ec\+\_\+soe\+\_\+request\+\_\+alloc()}
{\footnotesize\ttfamily int ec\+\_\+soe\+\_\+request\+\_\+alloc (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$}]{req,  }\item[{size\+\_\+t}]{size }\end{DoxyParamCaption})}



Pre-\/allocates the data memory. 

If the {\itshape mem\+\_\+size} is already bigger than {\itshape size}, nothing is done.

\begin{DoxyReturn}{Returns}
0 on success, otherwise -\/\+E\+N\+O\+M\+EM. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em req} & SoE request. \\
\hline
{\em size} & Data size to allocate. \\
\hline
\end{DoxyParams}


Definition at line 150 of file soe\+\_\+request.\+c.

\mbox{\label{soe__request_8c_a814c93a03b31ee5cc53ea6eec96a1bbc}} 
\index{soe\+\_\+request.\+c@{soe\+\_\+request.\+c}!ec\+\_\+soe\+\_\+request\+\_\+copy\+\_\+data@{ec\+\_\+soe\+\_\+request\+\_\+copy\+\_\+data}}
\index{ec\+\_\+soe\+\_\+request\+\_\+copy\+\_\+data@{ec\+\_\+soe\+\_\+request\+\_\+copy\+\_\+data}!soe\+\_\+request.\+c@{soe\+\_\+request.\+c}}
\subsubsection{ec\+\_\+soe\+\_\+request\+\_\+copy\+\_\+data()}
{\footnotesize\ttfamily int ec\+\_\+soe\+\_\+request\+\_\+copy\+\_\+data (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$}]{req,  }\item[{const uint8\+\_\+t $\ast$}]{source,  }\item[{size\+\_\+t}]{size }\end{DoxyParamCaption})}



Copies SoE data from an external source. 

If the {\itshape mem\+\_\+size} is to small, new memory is allocated.


\begin{DoxyRetVals}{Return values}
{\em 0} & Success. \\
\hline
{\em $<$0} & Error code. \\
\hline
\end{DoxyRetVals}

\begin{DoxyParams}{Parameters}
{\em req} & SoE request. \\
\hline
{\em source} & Source data. \\
\hline
{\em size} & Number of bytes in {\itshape source}. \\
\hline
\end{DoxyParams}


Definition at line 179 of file soe\+\_\+request.\+c.

\mbox{\label{soe__request_8c_a8a925ba4a167337f982e2af3cc94fe5b}} 
\index{soe\+\_\+request.\+c@{soe\+\_\+request.\+c}!ec\+\_\+soe\+\_\+request\+\_\+append\+\_\+data@{ec\+\_\+soe\+\_\+request\+\_\+append\+\_\+data}}
\index{ec\+\_\+soe\+\_\+request\+\_\+append\+\_\+data@{ec\+\_\+soe\+\_\+request\+\_\+append\+\_\+data}!soe\+\_\+request.\+c@{soe\+\_\+request.\+c}}
\subsubsection{ec\+\_\+soe\+\_\+request\+\_\+append\+\_\+data()}
{\footnotesize\ttfamily int ec\+\_\+soe\+\_\+request\+\_\+append\+\_\+data (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$}]{req,  }\item[{const uint8\+\_\+t $\ast$}]{source,  }\item[{size\+\_\+t}]{size }\end{DoxyParamCaption})}



Copies SoE data from an external source. 

If the {\itshape mem\+\_\+size} is to small, new memory is allocated.


\begin{DoxyRetVals}{Return values}
{\em 0} & Success. \\
\hline
{\em $<$0} & Error code. \\
\hline
\end{DoxyRetVals}

\begin{DoxyParams}{Parameters}
{\em req} & SoE request. \\
\hline
{\em source} & Source data. \\
\hline
{\em size} & Number of bytes in {\itshape source}. \\
\hline
\end{DoxyParams}


Definition at line 203 of file soe\+\_\+request.\+c.

\mbox{\label{soe__request_8c_a9eef801a2dec94ecd2ea20fa3b9bb3c2}} 
\index{soe\+\_\+request.\+c@{soe\+\_\+request.\+c}!ec\+\_\+soe\+\_\+request\+\_\+read@{ec\+\_\+soe\+\_\+request\+\_\+read}}
\index{ec\+\_\+soe\+\_\+request\+\_\+read@{ec\+\_\+soe\+\_\+request\+\_\+read}!soe\+\_\+request.\+c@{soe\+\_\+request.\+c}}
\subsubsection{ec\+\_\+soe\+\_\+request\+\_\+read()}
{\footnotesize\ttfamily void ec\+\_\+soe\+\_\+request\+\_\+read (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$}]{req }\end{DoxyParamCaption})}



Request a read operation. 


\begin{DoxyParams}{Parameters}
{\em req} & SoE request. \\
\hline
\end{DoxyParams}


Definition at line 232 of file soe\+\_\+request.\+c.

\mbox{\label{soe__request_8c_a02f5e4b5047b8722d5df2096860807bb}} 
\index{soe\+\_\+request.\+c@{soe\+\_\+request.\+c}!ec\+\_\+soe\+\_\+request\+\_\+write@{ec\+\_\+soe\+\_\+request\+\_\+write}}
\index{ec\+\_\+soe\+\_\+request\+\_\+write@{ec\+\_\+soe\+\_\+request\+\_\+write}!soe\+\_\+request.\+c@{soe\+\_\+request.\+c}}
\subsubsection{ec\+\_\+soe\+\_\+request\+\_\+write()}
{\footnotesize\ttfamily void ec\+\_\+soe\+\_\+request\+\_\+write (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+soe\+\_\+request\+\_\+t} $\ast$}]{req }\end{DoxyParamCaption})}



Request a write operation. 


\begin{DoxyParams}{Parameters}
{\em req} & SoE request. \\
\hline
\end{DoxyParams}


Definition at line 245 of file soe\+\_\+request.\+c.

